import Vue from 'vue';
import env from '../deploy/env';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const router = new VueRouter({
  mode: 'history',
  //base: env.baseRouter,
  routes: [
    {
      path: '/',
      meta: { title: '歌力思' },
      component: () => import('@/views/home')
    },
    {
      path: '/salesReport',
      name: 'salesReport',
      meta: { title: '集团销售报表' },
      component: () => import('../views/salesReport.vue')
    },
    {
      path: '/ideaList',
      name: 'ideaList',
      meta: { title: '金点子列表'},
      component: () => import('../views/idea/list.vue')
    },
    {
      path: '/myIdea',
      name: 'myIdea',
      meta: { title: '我的金点子'},
      component: () => import('../views/idea/myIdea.vue')
    },
    // {
    //   path: '/myIdea',
    //   name: 'myIdea',
    //   meta: { title: '我的金点子' },
    //   component: () => import('../views/idea/list.vue')
    // },
    {
      path: '/ideaDetail',
      name: 'ideaDetail',
      meta: { title: '金点子详情'},
      component: () => import('../views/idea/add.vue')
    },
    {
      path: '/addIdea',
      name: 'addIdea',
      meta: { title: '提金点子' },
      component: () => import('../views/idea/add.vue')
    },
    {
      path: '/pictureList',
      name: 'pictureList',
      meta: { title: 'ELLASSAY图片列表' },
      component: () => import('../views/picture/pictureLibrary.vue')
    },
    {
      path: '/e26ce027431d5cd4',
      name: 'e26ce027431d5cd4',
      meta: { title: 'ELLASSAY图片列表' },
      component: () => import('../views/picture/pictureLibrary.vue')
    },
    {
      path: '/iroPicture',
      name: 'iroPicture',
      meta: { title: 'IRO Paris图片列表' },
      component: () => import('../views/picture/iroPicture.vue')
    },
    {
      path: '/laurelPicture',
      name: 'laurelPicture',
      meta: { title: 'Laurèl图片列表' },
      component: () => import('../views/picture/laurelPicture.vue')
    },
    {
      path: '/spPicture',
      name: 'spPicture',
      meta: { title: 'self-portait图片列表' },
      component: () => import('../views/picture/spPicture.vue')
    },
    {
      path: '/testPicture',
      name: 'testPicture',
      meta: { title: '测试图片列表' },
      component: () => import('../views/picture/testPicture.vue')
    },
    {
      path: '/edPicture',
      name: 'edPicture',
      meta: { title: 'Ed Hardy图片列表' },
      component: () => import('../views/picture/edPicture.vue')
    },
    {
      path: '/nobisPicture',
      name: 'nobisPicture',
      meta: { title: '歌力思男装素材库' },
      component: () => import('../views/picture/nobisPicture.vue')
    },
    {
      path: '/rank',
      name: 'rank',
      meta: { title: '商场排名' },
      component: () => import('../views/shoppingmallRank.vue')
    },
    {
      path: '/preSale',
      name: 'preSale',
      meta: { title: '预售录入' },
      component: () => import('../views/preSale/preSale.vue')
    },
    {
      path: '/preSaleList',
      name: 'preSaleList',
      meta: { title: '录入记录' },
      component: () => import('../views/preSale/list.vue')
    },
    {
      path: '/classifyTotal',
      name: 'classifyTotal',
      meta: { title: '渠道分类汇总' },
      component: () => import('../views/reportForm/classifyTotal.vue')
    },
    {
      path: '/testForm',
      name: 'testForm',
      meta: { title: '渠道分类汇总' },
      component: () => import('../views/reportForm/testForm.vue')
    },
    {
      path: '/reportClassificate',
      name: 'reportClassificate',
      meta: { title: '报表分类' },
      component: () => import('../views/reportForm/reportClassificate.vue')
    },
    {
      path: '/dailySalesWarehouse',
      name: 'dailySalesWarehouse',
      meta: { title: '区域销售报表' },
      component: () => import('../views/reportForm/dailySalesWarehouse.vue')
    },
    {
      path: '/monthSalesWarehouse',
      name: 'monthSalesWarehouse',
      meta: { title: '区域销售报表' },
      component: () => import('../views/reportForm/monthSalesWarehouse.vue')
    },
    {
      path: '/areaReportDetail',
      name: 'areaReportDetail',
      meta: { title: '门店销售报表' },
      component: () => import('../views/reportForm/areaReportDetail.vue')
    },
    {
      path: '/monthAreaDeatil',
      name: 'monthAreaDeatil',
      meta: { title: '门店销售报表' },
      component: () => import('../views/reportForm/monthAreaDeatil.vue')
    },
    {
      path: '/dailyReportChannel',
      name: 'dailyReportChannel',
      meta: { title: '渠道销售报表' },
      component: () => import('../views/reportForm/dailyReportChannel.vue')
    },
    {
      path: '/dailySalesOnLine',
      name: 'dailySalesOnLine',
      meta: { title: '线上-日销售报表' },
      component: () => import('../views/reportForm/dailySalesOnLine.vue')
    },
    {
      path: '/report',
      name: 'report',
      meta: { title: '集团报表' },
      component: () => import('../views/reportForm/report.vue')
    },


    //新报表-----------
    // {
    //   path: '/reportData',
    //   name: 'reportData',
    //   meta: { title: '集团报表' },
    //   component: () => import('../views/reportData/index.vue')
    // },
    {
      path: '/reportClassNew',
      name: 'reportClassNew',
      meta: { title: '分类' },
      component: () => import('../views/reportData/reportClassificate.vue')
    },
    {
      path: '/areaReport',
      name: 'areaReport',
      meta: { title: '区域报表' },
      component: () => import('../views/reportData/areaReport.vue')
    },
    {
      path: '/storeReport',
      name: 'storeReport',
      meta: { title: '门店报表' },
      component: () => import('../views/reportData/storeReport.vue')
    },
    //end  新报表-----------
    // pdm
    {
      path: '/buildNo',
      name: 'buildNo',
      meta: { title: '建款' },
      component: () => import('../views/pdm/buildNo.vue')
    },
    {
      path: '/approvalList',
      name: 'approvalList',
      meta: { title: '审批列表' },
      component: () => import('../views/pdm/approvalList.vue')
    },
    {
      path: '/approvalDetail',
      name: 'approvalDetail',
      meta: { title: '审批内容' },
      component: () => import('../views/pdm/approvalDetail.vue')
    },
    {
      path: '/addSupplier',
      name: 'addSupplier',
      meta: { title: '申请' },
      component: () => import('../views/supplier/add.vue')
    },
    //end pdm
    {
      path: '/marketRank',
      name: 'marketRank',
      meta: { title: '商场排名' },
      component: () => import('../views/marketRank/index.vue')
    },
    // {
    //   path: '/testreportData',
    //   name: 'testreportData',
    //   meta: { title: '测试集团报表' },
    //   component: () => import('../views/reportForm/testReport.vue')
    // },
    // start 职业性格测试
    {
      path: '/personalityTest',
      name: 'personalityTest',
      meta: { title: 'MBTI职业性格测评' },
      component: () => import('../views/personalityTest/index.vue')
    },
    {
      path: '/subjectList',
      name: 'subjectList',
      meta: { title: '题目列表' },
      component: () => import('../views/personalityTest/subjectList.vue')
    },
    {
      path: '/result',
      name: 'result',
      meta: { title: '测评结果' },
      component: () => import('../views/personalityTest/result.vue')
    },
    {
      path: '/staffList',
      name: 'staffList',
      meta: { title: '员工列表' },
      component: () => import('../views/personalityTest/staffList.vue')
    },
    // end 职业性格测试
    //start 可持续发展资料
    {
      path: '/sustainableType',
      name: 'sustainableType',
      meta: { title: '可持续时尚' },
      component: () => import('../views/sustainableData/index.vue')
    },
    {
      path: '/sustainableList',
      name: 'sustainableList',
      meta: { title: '内容列表' },
      component: () => import('../views/sustainableData/list.vue')
    },
    {
      path: '/articleDetial',
      name: 'articleDetial',
      meta: { title: '内容详情' },
      component: () => import('../views/sustainableData/detail.vue')
    },
    {
      path: '/test',
      name: 'test',
      meta: { title: '测试' },
      component: () => import('../views/test.vue')
    },
    {
      path: '*',
      meta: { title: '404' },
      component: () => import('../views/404.vue'),
      //redirect: '/404'
    }
  ],
  // scrollBehavior(to,from,savePosition){
  //   return {
  //     x:0,
  //     y:0
  //   }
  // }
});

router.beforeEach((to, from, next) => {
  document.title=to.meta.title
  next()
})
export default router;
